package com.yumeng.system.main.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yumeng.common.api.IResultData;
import com.yumeng.framework.data.enums.LockedFlag;
import com.yumeng.framework.data.enums.Status2Flag;
import com.yumeng.framework.persistence.mybatis.base.entity.MpBaseEntity_CUD;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * @author wxd
 * @date 2024/9/25 17:24
 */
@Getter
@Setter
@TableName(value = "sys_user", autoResultMap = true)
@Schema(name = "SysUser", description = "系统用户")
public class SysUser extends MpBaseEntity_CUD implements IResultData {

    @Schema(description = "用户ID")
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    private Long userId;
    @Schema(description = "用户名")
    @TableField("username")
    private String username;
    @Schema(description = "真实姓名")
    @TableField("real_name")
    private String realName;
    @Schema(description = "用户类型")
    @TableField("user_types")
    private String userTypes;
    @Schema(description = "登录密码")
    @TableField("password")
    private String password;
    @Schema(description = "盐")
    @TableField("salt")
    private String salt;
    @Schema(description = "手机号")
    @TableField("phone")
    private String phone;
    @Schema(description = "身份证号码")
    @TableField("id_card_no")
    private String idCardNo;
    @Schema(description = "电子邮件")
    @TableField("email")
    private String email;
    @Schema(description = "昵称")
    @TableField("nickname")
    private String nickname;
    @Schema(description = "用户性别（0-未知 1-男 2-女）")
    @TableField("sex")
    private Integer sex;
    @Schema(description = "头像路径")
    @TableField("avatar")
    private String avatar;
    @Schema(description = "角色（临时）")
    @TableField("roles")
    private String roles;
    @Schema(description = "权限（临时）")
    @TableField("perms")
    private String perms;
    @Schema(description = "登录ip")
    @TableField("last_login_ip")
    private String lastLoginIp;
    @Schema(description = "登录时间")
    @TableField("last_login_time")
    private LocalDateTime lastLoginTime;
    @Schema(description = "密码更新时间")
    @TableField("pwd_update_time")
    private LocalDateTime pwdUpdateTime;
    @Schema(description = "状态 1-正常 2-停用")
    @TableField("status")
    private Status2Flag status;
    @Schema(description = "锁定标识")
    @TableField("lock_flag")
    private LockedFlag lockFlag;
    @Schema(description = "备注")
    @TableField("remark")
    private String remark;
}
